import Vue from "vue";
import App from "./App";
import store from "./store";

import "./uni.promisify.adaptor";

import uView from "uview-ui";
Vue.use(uView);

import {
  dayjs,
  timeFormat,
  timeDiff,
  hideIdCardNo,
  hideMobileNo,
  hideBankCardNo,
} from "./utils/filters";
Vue.filter("timeFormat", timeFormat); // 覆盖 uview 的设置
uni.$u.timeFormat = timeFormat;
uni.$u.date = undefined;
uni.$u.dayjs = dayjs;
Vue.filter("timeDiff", timeDiff);
Vue.filter("hideIdCardNo", hideIdCardNo);
Vue.filter("hideMobileNo", hideMobileNo);
Vue.filter("hideBankCardNo", hideBankCardNo);

Vue.config.productionTip = false;

App.mpType = "app";

const app = new Vue({
  ...App,
  store,
});

// 引入请求封装，将app参数传递到配置中
require("./utils/request.js")(app);

app.$mount();
